$(document).ready(function () {

    //点击返回
    $(".go-back").click(function () {
        var url = $(this).attr("url");
        console.log(url);
        window.location = url;
    });

    //进入任务列表
    $(".btn-enter-tasklist").click(function () {
        var url = $(this).attr("url");
        console.log(url);
        window.location = url;
    });

    //保存图片
    $(".btn-save-pic").click(function () {
        // html2canvas(document.querySelector("#middle-wrap"), { scale: 3, dpi: 120 }).then(canvas => {
        html2canvas(document.querySelector("#product-wrap")).then(canvas => {
            // blob
            canvas.toBlob(blob => {
                const href = window.URL.createObjectURL(new Blob([blob]))
                const link = document.createElement('a')
                link.href = href
                link.download = 'order.png'
                document.body.appendChild(link)
                link.click()
                document.body.removeChild(link)
            }, 'image/png')
        });
    })

});
